# -*- coding: utf-8 -*- 
# @Time : 2021/4/7 12:01 
# @Author : Dong 
# @File : paaa.py
import os
import re

from pyquery import PyQuery as pq
import requests
with open('paa.html','r',encoding='utf-8')as book:
    ps = book.read()

# G:\tokyo_fashion
proxies = { "http": None, "https": None}
# requests.get("http://ff2.pw", proxies=proxies)

doc = pq(ps)
items = doc('.articles-list .news-block').items()
for i in items:
    product = {
        'src_ip':i.find('.photo').attr('href'),
        'title':i.find('.news-ititle').text(),
        'discrption':i.find('.news-desc').text()
    }
    print(product)
    response = requests.get(product.get('src_ip'),proxies=proxies)
    html = response.text
    doc2 = pq(html)
    d_items = doc2('.gallery .gallery-row').items()
    for d_item in d_items:
        det = d_item('.portrait img').attr('srcset')
        pattern = re.compile('768w,(.*?) 1000w', re.S)
        data = re.findall(pattern, det)
        for i in data:
            print(i)

"(.*?)"

